using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CreateProp : MonoBehaviour
{
    public GameObject[] Prop;
    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("createprop", 3f, 25f);
    }
    void createprop()
    {
        if (PlayerInfo.state == PlayerInfo.NOW.Playing)
        {
            int nunmber = Random.Range(0, Prop.Length);
            Vector3 prop_position = new Vector3(Random.Range(-8, 9), 6, 7);
            Vector3 rot = new Vector3(0, 90, 0);
            Destroy(Instantiate(Prop[nunmber], prop_position, Quaternion.Euler(rot)), 10f);
        }
        
    }
}
